﻿using System;

using System.Data;

using System.Configuration;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

namespace WebRaoVat
{
    public class TaskScheduler
    {
        #region Fields

        Task task = null;

        #endregion

        #region Public Constructors

        public TaskScheduler(double times, int maTinRaoVat, DateTime thoiGianBatDau, DateTime thoiGianKetThuc)
        {
            Initialize(times, maTinRaoVat, thoiGianBatDau, thoiGianKetThuc);
        }

        #endregion

        #region Public Methods
        public void StartTask()
        {
            this.task.Start();
        }
        public void StopTask()
        {
            this.task.Stop();
        }

        #endregion

        #region Public Constructors
        private void Initialize(double times, int maTinRaoVat, DateTime thoiGianBatDau, DateTime thoiGianKetThuc)
        {
            this.task = new Task(times);
            //this.task.FilePath = filePath;
            this.task.maTinRaoVat = maTinRaoVat;
            this.task.thoiGianKetThuc = thoiGianKetThuc;
            this.task.thoiGianBatDau = thoiGianBatDau;
        }

        #endregion
    }
}
